<template>
  <div class="h100 w100">
    <div class="settledEnt-top" @click="gohome()">
      <img src="~@/assets/reception/logo.png" />
    </div>
    <div class="container a-df">
      <div class="latest-entry">
        <span class="latest-title">最新入驻</span>
        <div class="latest-entry-items">
          <div class="latest-entry-item" :class="{ 'isshow-settledEnt': item.isshow }" v-for="(item,index) in latestEntry" :key="index" @click="checkEntry(item.ID)">
            <img :src="upload + item.GSZZZS" alt="">
            <span class="item-title">{{ displayContent(item.GSNAME,10) }}</span>
            <span class="item-content">{{ displayContent(item.NAME,100) }}</span>
            <span class="item-time">{{ item.AddTime }}</span>
          </div>
        </div>
      </div>
      <div class="latest-detail">
        <div class="detail-title">贵州宝德电子技术有限责任公司</div>
        <div class="detail-introduce">
          <span>宝德云主机服务</span>
          <a-tag color="blue">
            IT/软件
          </a-tag>
          <a-tag color="blue">
            信息技术服务
          </a-tag>
        </div>
        <div class="detail-price">
          参考服务价格(可议价)
          <span>￥3000.00-150000.00</span>
        </div>
        <div class="detail-qualification">
          <div class="qualification-title">资质证书查看：</div>
          <div class="a-df qualification-item">
            <img src="~@/assets/reception/serviceItems/guarantee.png" alt="">
            <img src="~@/assets/reception/serviceItems/price.png" alt="">
            <img src="~@/assets/reception/serviceItems/acceptance.png" alt="">
          </div>
        </div>
        <div class="detail-service-details">
          <div class="service-title">
            <div class="a-df">
              <span class="span1"></span>
              <span class="span2"></span>
              <span class="span3"></span>
            </div>
            <p class="">服务详情</p>
            <div class="a-df">
              <span class="span3"></span>
              <span class="span2"></span>
              <span class="span1"></span>
            </div>
          </div>
          <div class="service-content">
            宝德云主机服务支持按需配置资源，支持运算资源的伸缩配置、弹性配置，支持在线实时快照管理，支持在线内网组
支持应用系统大并发应用，支持公网IP接入，支持ICP的备案管理，吉持云盘管理，支持企业邮箱管理、提醒管理等
宝德云服务器是一种简单高效、处理能力可弹性伸缩的运算计算资源服务，可以帮助企业快速构建更稳定、安全的应
用，提升运维效率，降低IT成本企业使您更专注于核心业务创新。
建，
企业可根据不同需求，自由选择VCPU、内存数据盘、带宽等配置，还可随时不停机升级带宽，1分钟内停机升级VCP
U和内存
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getAPPgetQYZCListApi } from '@/api/resService'
export default {
  data () {
    return {
      upload:process.env.VUE_APP_API_BASE_URL,
      latestEntry:[],
      settledEntDetailItem:{}
    }
  },
  methods: {
    displayContent(text , num) {
      if ( text <= num) {
        return text;
      }
      return text.slice(0, num) + '...';
    },
    getAPPgetQYZCList() {
      getAPPgetQYZCListApi({
        pageSize: 10,
        pageIndex: 1,
        RMTJ: 1,
      })
        .then((res) => {
          this.latestEntry = res.data
          for (const item of this.latestEntry) {
            this.$set(item, 'isshow', false);
          }
          this.latestEntry[0].isshow=true
        })
        .catch((err) => {})
        .finally(() => {})
    },
    checkEntry(id){
      for (const item of this.latestEntry) {
        if (item.ID == id) {
          item.isshow=true
        }else{
          item.isshow=false
        }
      }
      // getAppGetNewsByIDApi({
      //     ID:id
      //   }).then((res)=>{
      //     console.log('res:', res);
      //     this.newsDetail = res.data[0]
      //   }).catch((err)=>{
      //     console.log('err:', err);
      //   })
    },
    gohome() {
      this.$router.push({ path: '/reception/findServices/index' });
    },
  },
  mounted() {
    this.getAPPgetQYZCList()
  },
}
</script>

<style lang="less" scoped>
.isshow-settledEnt{
  box-shadow: 2px 4px 8px #2f71f8;
}
.settledEnt-top{
  height: 60px;
  background: #fff;
  padding: 10px 100px ;
  cursor: pointer;
  img{
    height: 40px;
    display: block;
  }
}
.latest-entry{
  width: 300px;
  background: #ededed;
  border-radius: 20px;
  height: 850px;
  overflow-y: scroll;
  .latest-title{
    display: block;
    background: #486dee;
    color: #fff;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    width: 100%;
    height: 50px;
    margin-bottom: 20px;
  }
  .latest-entry-items{
    display: flex;
    flex-direction:column;
    .latest-entry-item{
      background: #fff;
      cursor: pointer;
      border-radius:10px ;
      overflow: hidden;
      height: 300px;
      margin: 20px;
      img{
        width: 100%;
        height: 150px;
      }
      .item-title{
        display: block;
        font-size: 18px;
        width: 260px;
        margin: 10px 20px;
      }
      .item-content{
        display: block;
        // font-size: 18px;
        // width: 260px;
        margin: 10px 20px;
      }
      .item-time{
        display: block;
        color: #cfcece;
        margin: 10px 20px;
      }
    }
  }
}
.latest-detail{
  margin: 20px;
  flex: 1;
  .detail-title{
    font-size: 24px;
    margin: 20px 0;
  }
  .detail-introduce{
    span{
      display: inline-block;
      margin-right: 10px;
    }
  }
  .detail-price{
    margin: 20px 0;
    span{
      color: #d47676;
    }
  }
  .detail-qualification{
    text-align: center;
    .qualification-title{
      margin: 10px 0;
      color: #cfcece;
    }
    .qualification-item{
      img{
        margin: 0 20px;
      }
    }
  }
}
.detail-service-details{
  // width: 100%;
  .service-title{
    display: flex;
    justify-content: center;
    margin: 20px auto;
    font-size: 24px;
    span{
      background: #2f71f8;
      display: inline-block;
      // margin: 0 5px;
      justify-content: center;
      align-items: center;
      border-radius: 20px;
      margin: auto 5px;
    }
    p{
      display: flex;
      margin: 0 20px;
    }
    .span1{
      width: 5px;
      height: 5px;
    }
    .span2{
      width: 10px;
      height: 10px;
    }
    .span3{
      width: 15px;
      height: 15px;
    }
  }
  .service-content{
    width: 100%;
  }
}
</style>
